import express from 'express'import cors from 'cors'import bodyParser from 'body-parser'import router from './router.js'import swaggerUi from 'swagger-ui-express'import fs from 'fs'import YAML from 'yaml'const file = fs.readFileSync('./api.yaml', 'utf8')const swaggerDocument = YAML.parse(file)const app = express()app.use(cors({ origin: '*' }))// parse application/x-www-form-urlencodedapp.use(bodyParser.urlencoded({ extended: false }))// parse application/jsonapp.use(bodyParser.json())app.use('/api', router)app.use('/swagger', swaggerUi.serve, swaggerUi.setup(swaggerDocument))app.listen(5000, () => {  console.log('JSON Server is running on port 5000')})